class Solution(object):
    def numberOfLines(self, widths, s):
        """
        :type widths: List[int]
        :type s: str
        :rtype: List[int]
        """
        row = 1
        count = 0
        for c in s:
            if count + widths[ord(c) - ord('a')] <= 100:
                count += widths[ord(c) - ord('a')]
            else:
                row += 1
                count = widths[ord(c) - ord('a')]
        return [row, count]